<?php

/**
 * @author luhua
 */
class NewsModel extends Model {

    protected $_validate = array(
        array('title', 'require', '请输入标题'),
        array('content', 'require', '请输入内容')
    );
    public $_auto = array(
        array('create_at', 'nowDate', self::MODEL_INSERT, 'callback'),
        array('status', 'setStatus', self::MODEL_INSERT, 'callback')
    );

    public function nowDate() {
        return date('Y-m-d H:i:s', time());
    }
    public function setStatus() {
        return 1;
    }

}

?>
